Platform Explorer / Nuxeo Platform 5.8

Contribution org.nuxeo.ecm.social.workspace.gadgets.library--gadget

This contribution is part of XML component org.nuxeo.ecm.social.workspace.gadgets.library inside nuxeo-social-workspace-gadgets-library-5.8.jar

Extension Point

Extension point gadget of component service.

Contributed Items

  • <internalGadget disabled="false" name="library">
          <documentation>
            This gadget displays the mini messages of a user, or the mini messages
            of the user's network.
    
            The following user preferences can be used to configure it:
            - nuxeoTargetContextPath: the path of the document on which to
              initialize the document library
            - documentLinkBuilder: the codec name to use to generate
              documents URLs
    
            How to include the library gadget in a JSF context:
            <code>
              <div class="gadget-library threeQuarterWidth"/>
              <script type="text/javascript">
                jQuery('.gadget-library').openSocialGadget({
                  baseURL: '#{baseURL}',
                  language: '#{localeSelector.language}',
                  gadgetDefs: [
                    { specUrl: '#{gadgetsBaseURL}/site/gadgets/library/library.xml',
                      title: '',
                      userPrefs: {
                        nuxeoTargetContextPath: {
                          value: '#{currentDocument.pathAsString}'
                        },
                        documentLinkBuilder: {
                          value: 'docid'
                        }
                      },
                      displayTitleBar: false,
                      width: '100%'
                    }
                  ]
                });
              </script>
            </code>
    
            How to include the library gadget in a WebEngine page:
            <code>
              <link href="${contextPath}/css/opensocial/light-container-gadgets.css" rel="stylesheet"/>
              <script src="${contextPath}/opensocial/gadgets/js/rpc.js?c=1" type="text/javascript"/>
              <script src="${contextPath}/js/?scripts=jquery.js|opensocial/cookies.js|opensocial/util.js|opensocial/gadgets.js|opensocial/cookiebaseduserprefstore.js|opensocial/jquery.opensocial.gadget.js" type="text/javascript"/>
    
              <div class="gadget-library gadgets-gadget-chrome"/>
              <script type="text/javascript">
                $('.gadget-library').openSocialGadget({
                  baseURL: '${contextPath}' + '/',
                  language: '${Context.locale.language}',
                  gadgetDefs: [{
                    specUrl : '${Runtime.getProperty('nuxeo.loopback.url')}/site/gadgets/library/library.xml',
                    userPrefs: {
                      nuxeoTargetContextPath: {
                        value: '${doc.pathAsString}'
                      },
                      documentLinkBuilder: {
                        value: 'docid'
                      }
                    },
                    displayTitleBar: false,
                    width: '100%'
                  }]
                });
              </script>
            </code>
          </documentation>
    
          <mountPoint>/library</mountPoint>
          <directory>library</directory>
          <entryPoint>library.xml</entryPoint>
          <category>gadget.category.social.workspace.private</category>
          <icon>gadget-library.png</icon>
        </internalGadget>

    This gadget displays the mini messages of a user, or the mini messages of the user's network. The following user preferences can be used to configure it: - nuxeoTargetContextPath: the path of the document on which to initialize the document library - documentLinkBuilder: the codec name to use to generate documents URLs How to include the library gadget in a JSF context: How to include the library gadget in a WebEngine page:

XML Source

<extension point="gadget" target="org.nuxeo.opensocial.gadgets.service">

    <internalGadget disabled="false" name="library">
      <documentation>
        This gadget displays the mini messages of a user, or the mini messages
        of the user's network.

        The following user preferences can be used to configure it:
        - nuxeoTargetContextPath: the path of the document on which to
          initialize the document library
        - documentLinkBuilder: the codec name to use to generate
          documents URLs

        How to include the library gadget in a JSF context:
        <code>
          <div class="gadget-library threeQuarterWidth"/>
          <script type="text/javascript">
            jQuery('.gadget-library').openSocialGadget({
              baseURL: '#{baseURL}',
              language: '#{localeSelector.language}',
              gadgetDefs: [
                { specUrl: '#{gadgetsBaseURL}/site/gadgets/library/library.xml',
                  title: '',
                  userPrefs: {
                    nuxeoTargetContextPath: {
                      value: '#{currentDocument.pathAsString}'
                    },
                    documentLinkBuilder: {
                      value: 'docid'
                    }
                  },
                  displayTitleBar: false,
                  width: '100%'
                }
              ]
            });
          </script>
        </code>

        How to include the library gadget in a WebEngine page:
        <code>
          <link href="${contextPath}/css/opensocial/light-container-gadgets.css" rel="stylesheet"/>
          <script src="${contextPath}/opensocial/gadgets/js/rpc.js?c=1" type="text/javascript"/>
          <script src="${contextPath}/js/?scripts=jquery.js|opensocial/cookies.js|opensocial/util.js|opensocial/gadgets.js|opensocial/cookiebaseduserprefstore.js|opensocial/jquery.opensocial.gadget.js" type="text/javascript"/>

          <div class="gadget-library gadgets-gadget-chrome"/>
          <script type="text/javascript">
            $('.gadget-library').openSocialGadget({
              baseURL: '${contextPath}' + '/',
              language: '${Context.locale.language}',
              gadgetDefs: [{
                specUrl : '${Runtime.getProperty('nuxeo.loopback.url')}/site/gadgets/library/library.xml',
                userPrefs: {
                  nuxeoTargetContextPath: {
                    value: '${doc.pathAsString}'
                  },
                  documentLinkBuilder: {
                    value: 'docid'
                  }
                },
                displayTitleBar: false,
                width: '100%'
              }]
            });
          </script>
        </code>
      </documentation>

      <mountPoint>/library</mountPoint>
      <directory>library</directory>
      <entryPoint>library.xml</entryPoint>
      <category>gadget.category.social.workspace.private</category>
      <icon>gadget-library.png</icon>
    </internalGadget>

  </extension>